package com.ym521.demo

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.google.android.material.snackbar.Snackbar
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import android.view.Menu
import android.view.MenuItem
import android.widget.TextView
import com.ym521.demo.databinding.ActivityMainBinding
import com.ym521.demo.databinding.ActivityNextBinding

class MainActivity02 : AppCompatActivity() {

    private lateinit var binding: ActivityNextBinding

//    private lateinit var tvContent: TextView
//    private lateinit var content:String

    companion object {
        fun createIntent(mContext: Context): Intent {

            return Intent(mContext, MainActivity02::class.java)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityNextBinding.inflate(layoutInflater)
        setContentView(binding.root)
        binding.apply {
            tvContent.setOnClickListener {
                startActivity(MainActivity.createIntent(this@MainActivity02))
            }
        }
//        binding.root.postDelayed({
//            tvContent.text = "1111"
//        }, 3 * 1000)
//        Thread {
//            Thread.sleep(1000*5)
//            val size = content.length
//        }.start()
    }

    override fun onPause() {
        super.onPause()
//        tvContent.text = "1111"
    }

}